<?php
//require_once  __DIR__ . '/includes/authenticate.php';

if ( isset($_POST['ID']) && isset($_POST['text']) && isset($_POST['category']) ) {
	
	include_once './db_bb_connect.php';

	$category = $_POST['category'];
	$text = $_POST['text'];
	$ID = $_POST['ID'];
	$visibility = $_POST['visibility'];


	$sql = "UPDATE attentionpointsplayers 
	SET category = '$category', text = '$text', visibility = '$visibility'
	WHERE ID = $ID";

	if ($db->query($sql)){
		echo "<br><center> Attention point succesfully updated! </center>";
	} else {
		echo "Something went wrong";
		echo "Error: " . $sql . "<br>" . $db->error;
	};

}


?>